package com.onpositive.simple.persistance;

public class FSTreeNode extends AbstractTreeNode {
	
//	private  FSNodeStorage nodeStorage ;
	protected int offset;
	protected int index ;
	protected int localContainer[] ;
	
	public FSTreeNode(FSNodeStorage nodeStorage, int index, int nodeSize ) {
		super();
//		this.nodeStorage = nodeStorage;
		this.index = index;
		localContainer = new int[nodeSize] ;
	}
	public FSTreeNode(FSNodeStorage nodeStorage, int index, int nodeSize, int[] container ) {
		super();
//		this.nodeStorage = nodeStorage;
		this.index = index;
		localContainer = new int[nodeSize] ;
		if( container.length == nodeSize )
			for( int i = 0 ; i < nodeSize ; i++ )
				localContainer[i] = container[i] ;
	}

	@Override
	public int getElement(int i) {
		return localContainer[ offset+i ] ;
	}

	@Override
	public void setElement(int i, int value) {
		localContainer[ offset+i ] = value ;
	}

	@Override
	public int getIndex(){ return index ; }
	
	@Override
	public void setIndex( int i){ index = i ; }
}
